Repository navigation
DEV-1198 Re-enable the three excluded ShimmerDriverPC simulator test classes - #326
Conversation
API_0000X_ByteCommunicationShimmer3lns0_16_11_w_sd_only, _w_sync_master and _w_sync_slave were excluded from the test task in Feb 2026 as failing on CI. Their CI logs have expired, so the cause cannot be confirmed, but it fits the read-status timer deadlock the previous commit avoids: these classes assert values from the post-connect config read (SD log sync, Bluetooth disabled, sync nodes, trial duration), which a stalled connect never reaches. They now build their device through newShimmerPCWithoutStatusTimer() like the other simulator classes, and run again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
MAzalya
left a comment
There was a problem hiding this comment.
Looks good to merge. The change is small and correct, and it has been checked. One note below about the underlying deadlock, which this PR doesn't need to fix.
What I checked
-
The re-enabled tests ran on CI and passed. The run log shows
w_sd_only,w_sync_masterandw_sync_slaveeach runningtest001in about 1 s, and the run passed in both attempts. -
The checks can actually fail. These classes use the Java
assert(false)keyword, which does nothing unless assertions are enabled. Gradle's test task enables them by default and nothing in the build turns them off. -
They wait for the real post-connect config read. Each class goes through
connectAndWaitUntilInitialisedand then asserts values that only that read sets:w_sd_only: Bluetooth disabled.w_sync_master: master shimmer, trial duration 5, and the two sync node MACs.w_sync_slave: trial duration 5 and the two sync node MACs.
This supports the description's argument about why
w_sd_bt_streamingkept passing. -
The setUp changes match the other simulator classes, and the Shimmer2R exclude, which needs real hardware, is correctly left in place.
-
Merging is safe. The branch is 12 commits behind master, but none of those commits touch the test or driver code involved.
-
The
InterruptedException: sleep interruptedstack traces in stderr are not new. They come from teardown interrupting the IOThread, and every simulator class prints them. Optional cleanup in a later PR: they make the CI log look like something failed.
The deadlock is a real driver bug, and only the tests avoid it
The lock inversion is in the shipped driver on master (ShimmerDriver/.../bluetooth/ShimmerBluetooth.java):
getInstruction()(around line 5982) takessynchronized(mListofInstructions)and then callsgetListofInstructions().getListofInstructions()is asynchronizedmethod, so it then takes the device lock. That is list first, device second.- Every other accessor takes them the other way round:
writeInstruction,removeInstruction,clearAllInstructionsand the rest aresynchronizedmethods that then lockmListofInstructions.
In the real product the read-status timer is on, and it can run at the same time as the IOThread, so PC and Android users can hit this deadlock. #325 and #326 avoid it only in the tests, and I couldn't find a ticket for fixing the driver.
The likely fix is one line: in getInstruction(), read mListofInstructions.get(0) directly instead of calling getListofInstructions(). A regression test should then connect a plain new ShimmerPC(...) with the timer left on. Once that is in, newShimmerPCWithoutStatusTimer may no longer be needed. I suggest a follow-up ticket rather than adding it to this PR.
🤖 Generated with Claude Code
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Thanks for the thorough review, @MAzalya. Agreed on all of it. The driver deadlock now has its own ticket: DEV-1266. It's a production bug in CI is green on the updated branch (b7fb77a, master merged in, including #330): 243 of 243 tests, and the three re-enabled classes pass in under a second each. The red "copilot-pull-request-reviewer" check is only Copilot's review quota running out, not a test failure. The Could you approve when you get a chance? Your review went in as a comment, so the PR still shows as needing an approving review. 🤖 Generated with Claude Code |
Re-enables the three ShimmerDriverPC simulator test classes excluded from the test task in February 2026 ("DEV-658 exclude failing test class", b253f7b / 214610a / fe9e6be):
API_0000X_ByteCommunicationShimmer3lns0_16_11_w_sd_onlyAPI_0000X_ByteCommunicationShimmer3lns0_16_11_w_sync_masterAPI_0000X_ByteCommunicationShimmer3lns0_16_11_w_sync_slaveWhy they should pass now
#325 found that the simulator connect tests deadlocked on Linux CI. The read-status timer starts with no delay and takes the device lock, then the instruction-list lock. At the same moment the IOThread, picking up the first post-connect instruction in
getInstruction(), takes the same two locks the other way round. #325 avoids it in the tests: the simulator classes build their device throughByteCommunicationTestUtils.newShimmerPCWithoutStatusTimer(), so that timer never starts.These three classes now do the same. Their February CI logs have expired, so the original failure cannot be confirmed. The deadlock fits it, though: these classes assert values from the post-connect config read (SD log sync, Bluetooth disabled, sync nodes, trial duration), which a stalled connect never reaches.
w_sd_bt_streamingasserted only defaults, so it kept passing until #321 made it wait for the connect.Changes
ShimmerDriverPC/build.gradle: the threeexcludelines removed. The Shimmer2R exclude stays (it needs hardware).newShimmerPCWithoutStatusTimer()instead ofnew ShimmerPC().Verification
Kept separate from #325 so a failure here cannot turn master red.
🤖 Generated with Claude Code